package com.github.livebase.util;

import android.util.ArrayMap;
import android.util.Log;

import java.util.List;
import java.util.Map;

/**
 * @ClassName CastTime
 * @description:
 * @author: biao532
 * @create: 2023-12-28 20:27
 * @Version 1.0
 **/
public class CastTime {
    private static Map<String, Long> map = new ArrayMap<>();
    public static void start(String tag) {
        map.put(tag, System.currentTimeMillis());
    }
    public static void end(String tag) {
        if (!map.containsKey(tag)) {
            return;
        }
        long l = map.get(tag);
        Log.i("CastTime", String.format("%s cast %d ms", tag, (System.currentTimeMillis()-l)));
        map.remove(tag);
    }
}
